package com.han.fu.api.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.han.fu.api.business.entity.Channel;
import com.han.fu.api.business.model.ao.ChannelPageAo;
import com.han.fu.api.business.model.vo.ChannelVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 渠道Mapper接口
 *
 * @author star
 * @date 2021-08-05
 */
@Mapper
public interface ChannelMapper extends BaseMapper<Channel> {

    /**
     * 渠道分页查询
     *
     * @param ao 分页查询条件
     * @return Page<ChannelVo> 分页数据
     */
    Page<ChannelVo> queryChannelPage(ChannelPageAo ao);

    /**
     * 根据AppId和密钥查询渠道数量
     *
     * @param appId     AppId
     * @param secretKey 密钥
     * @return Integer
     */
    Integer queryChannelCount(@Param("appId") String appId, @Param("secretKey") String secretKey);
}
